//
//  ShopTableViewCell.m
//  代理端
//
//  Created by mac on 16/3/2.
//  Copyright © 2016年 sliver. All rights reserved.
//

#import "ShopTableViewCell.h"
@interface ShopTableViewCell()

@property(nonatomic,strong)UIView *view1;
@property(nonatomic,strong)UIView *view2;

@property(nonatomic,strong)UIView *view3;

@property(nonatomic,strong)UILabel *lab;

@end

@implementation ShopTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.view1= [[UIView alloc]init];
        self.view1.backgroundColor =rgb(235, 112, 52, 1);
        [self.contentView addSubview:self.view1];
        self.view2  =[[UIView alloc]init];
        self.view2.backgroundColor = rgb(242, 242, 242, 1);
        [self.view1 addSubview:self.view2];
        self.view3 = [[UIView alloc]init];
        self.view3.backgroundColor = rgb(242, 242, 242, 1);
        [self.view1 addSubview:self.view3];
        self.selectedBackgroundView = self.view1;
        self.lab = [[UILabel alloc]init];
        self.lab.textColor =[UIColor grayColor];
        [self.contentView addSubview:self.lab];
        
    }

    return self;
}
-(void)layoutSubviews
{
    NSLog(@"%f",self.frame.size.height);
    
    self.lab.frame = CGRectMake(20*KScr, 0, 300*KScr, self.frame.size.height);
    
    self.view1.frame = CGRectMake(0, 0, 375*KScr, self.frame.size.height);
    
    self.view2.frame = CGRectMake(0, 0, 10*KScr, self.frame.size.height);
    
    self.view3.frame = CGRectMake(365*KScr, 0, 10*KScr, self.frame.size.height );
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    if (selected) {
        self.lab.textColor =[UIColor whiteColor ];
        
    }else
    {
        self.lab.textColor =[UIColor grayColor];

    }

    // Configure the view for the selected state
}
-(void)changeName:(NSString *)str
{
    self.lab.text =str;
}
@end
